import React from "react";
import { Button, ButtonProps } from 'antd';
import { EditOutlined } from '@ant-design/icons';

import { withModal, mountModal } from "@yaf/pro-ui";

import AuthReport from "./AuthReport";

interface AuthReportBtnProps extends ButtonProps {
  accountId: string;
}

const AuthReportBtn: React.FC<AuthReportBtnProps> = ({ accountId, size = "small", ...buttonProps }) => {

  return <Button
    icon={<EditOutlined />}
    onClick={() => {
      const AuthReportModal = withModal(AuthReport);
      mountModal(<AuthReportModal
        modalProps={{
          title: "授权报告",
          width: "60%",
        }}
        accountId={accountId}
      />);
    }}
    {...buttonProps}
  >授权报告</Button>
}


export default AuthReportBtn;
